let li = document.querySelectorAll(`.tab li`);
for (let i = 0; i < li.length; i++) {
  li[i].addEventListener(`mouseenter`, function () {
    document.querySelector(`.tab .active`).classList.remove(`active`);
    this.classList.add(`active`);
    document.querySelector(`.products .active`).classList.remove(`active`);
    document.querySelector(`.products div:nth-child(${i + 1})`).classList.add(`active`);
  })
}